var MongoClient = require("mongodb").MongoClient
var url = "mongodb://localhost:27017/"

MongoClient.connect(url, {useNewUrlParser: true, useUnifiedTopology: true}, function(err, db) {
  if(err) throw err
  var dbo = db.db("laochen")
  var whereStr = {"username": "老陈"}
  dbo.collection("users").deleteOne(whereStr, function(err, obj) {
    if (err) throw err
    console.log("文档删除成功")
    db.close()
  })

})




